﻿ var business_to_imc = {
											"dnf":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400994:|m:11|f:KFXD17x"
											,"sg":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400793:|m:13|f:KFXD37x"
											,"ylzt":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400992:|m:11|f:KFDX18x"
											,"hx":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400794:|m:11|f:KFXD27x"
											,"xycq":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400793:|m:12|f:KFXD30x"
											,"dzs":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400795:|m:16|f:KFXD19x"
											,"bns":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400598:|f:KFXD43x"
											,"qqxl":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400992:|m:11|f:KFXD28x"
											,"dj2":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400794:|m:18|f:KFXD41x"
											,"xx":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400794:|m:16|f:KFXD41x"
											,"cf":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400993:|m:13|f:KFXD15x"
											,"qqkart":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400790:|m:11|f:KFXD11X"
											,"lol":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400998:|m:11|f:KFXD10x"
											,"xw":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400597:|m:11|f:KFXD12x"
											,"nz":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400993:|m:12|f:KFXD16x"
											,"qsj":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400790:|m:13|f:KFXD44x"
											,"qq_game":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400997:|m:12|f:KFXD9x"
											,"roco":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400798:|m:11|f:KFXD32x"
											,"qxzb":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400997:|m:11|f:KFXD8x"
											,"qqfarm":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400798:|m:13|f:KFXD33x"
											,"qqmuchang":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400798:|m:13|f:KFXD33x"
											,"/weixin/aq.html":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400594:|f:KFXD5x"
											,"/tenpay/freeze_account.html":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400995:|f:KFXD6x"
											,"/tenpay/resume_account_risk.html":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400995:|f:KFXD6x"
											,"/tenpay/bank_order.html":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400995:|f:KFXD6x"
											,"/tenpay/appeal_status.html":"http://crm2.qq.com/page/portalpage/wpa.php?uin=40012345&f=1&ty=1&ap=000011:400995:|f:KFXD6x"	
											};
var business_hide_imc = {
													"qqxy":"1"
													,"dmlq":"1"
													,"qqys":"1"
													,"qqcw":"1"
												};
 
 
 ;(function (mod){
	 var pgv_pre="PC.IMC.",
         urlpath = GetUrlRelativePath();
     if(typeof getUrlParam === 'function')
     {
         var gcode = getUrlParam('code');
     }else{
         var gcode = '';
     }
	 	if(gcode != '' && business_hide_imc[gcode])
	    	{
	    		$("#global_imc").hide();
	    	}
	 mod.openIMC=function(){
	    	var seg=location.pathname.split("/"),dir=seg[1],pop_id="";
	    	if(dir===""|| dir==="index.html"){//首页
	    		pop_id="HOME_PAGE";
	    	}else if(dir.indexOf("search_result")>-1){//搜索结果页面
	    		pop_id="SEARCH";
	    	}else if(dir.indexOf("tenpay")>-1){//
	    		pop_id="TENPAY";
	    	}else if(dir.indexOf("pay")>-1){//
	    		pop_id="PAY";
	    	}else if(dir.indexOf("game")>-1){//
	    		pop_id="GAME";
	    	}else if((dir.indexOf("aq")>-1) || (dir.indexOf("1.html")>-1)){//
	    		pop_id="AQ";
	    	}else if(dir.indexOf("weixin")>-1){//
	    		pop_id="WEIXIN";
	    	}else{
	    		pop_id=location.pathname;
	    	}
		 pgvSendClick({hottag:pgv_pre+'FROM.'+pop_id});
        if(urlpath =="/game/business.html"){
            if(gcode != '' && business_to_imc[gcode])
            {
                window.open(business_to_imc[gcode]);
                return '';
            }
        }
	    	else if(business_to_imc[urlpath])
	    	{
	    		window.open(business_to_imc[urlpath]);
	    		return '';
	    	}
		 $("#global_imc_popshade,#global_imc_pop").show();
	 };
	 mod.openIMCForSearch=function(){
		 pgvSendClick({hottag:pgv_pre+'SEARCH_TO_IMC'});
		 $("#global_imc_popshade,#global_imc_pop").show();
	 };
	 mod.closeIMC=function(obj,titles,links){
		 if(typeof obj !=='undefined'){
			pgvSendClick({hottag:pgv_pre+'OPEN_BIZ.'+titles});
		 }else{
			pgvSendClick({hottag:pgv_pre+'CLOSE_POP'});
		 }
		 $("#global_imc_popshade,#global_imc_pop").hide();
	 };
	 return mod;
})( window.KF ||window);
function GetUrlRelativePath(){
    var url = document.location.toString(),
        arrUrl = url.split("//"),
        start = arrUrl[1].indexOf("/"),
        relUrl = arrUrl[1].substring(start);//stop省略，截取从start开始到结尾的所有字符
    if(relUrl.indexOf("?") != -1){
        relUrl = relUrl.split("?")[0];
    }
    return relUrl;
}
